class Person(object):

    # 限定对象只能绑定 _name, _age and _gender properties
    __slots__ = ('_name', '_age', '_gender')

    def __init__(self, name, age):
        self._name = name
        self._age = age

    @property
    def name(self):
        return self._name

    @property
    def age(self):
        return self._age

    @age.setter
    def age(self, age):
        self._age = age

    def play(self):
        if self._age <= 16:
            print(f'{self._name} is playing basketball')
        else:
            print(f'{self._name} is playing football')


def main():
    p1 = Person('Onehitieoa', 13)
    p1.play()
    p1.age = 35
    p1.play()
    p1._gender = 'female'
    # p1._is_gay = True


if __name__ == '__main__':
    main()
